<p:dialog xmlns="http://www.w3.org/1999/xhtml"
      	  xmlns:h="http://java.sun.com/jsf/html"
      	  xmlns:f="http://java.sun.com/jsf/core"
      	  xmlns:ui="http://java.sun.com/jsf/facelets"
      	  xmlns:p="http://primefaces.org/ui"
      	  modal="false"  resizable="true" 
		  widgetVar="dialogProfessor" id="idDialogProfessor" closable="true"
		  appendToBody="true" header="Professores"> 	
  	
<h:form id="formDialogProfessor" >
<h:panelGroup id="pgDialogProfessor">

 	<p:messages id="messagesProfessor" showDetail="true"/> 
    	<h:panelGrid columns="2" style="text-align:center; margin-top:20px; margin-right:10%; margin-bottom:20px;">  
            <h:outputLabel value="Código" style="font-size:14px; float:left; padding-right:20px "/>  
            <h:outputLabel value="Professor" style="font-size:14px; float:left"/> 
            
            <p:inputText value="#{anamneseBean.professor.idFuncionario}" styleClass="inputId"/>  
  			<p:inputText value="#{anamneseBean.professor.nome}" styleClass="inputDescricao"/>  
        </h:panelGrid>  

    <p:commandButton value="Consultar" actionListener="#{anamneseBean.findFuncionario}" process="@this" update="dataTableAnamnese" 
    				 styleClass="commandButton" style="margin-left:0px;"/> 
	
    		
    <p:dataTable id="dataTableAnamnese" var="professor" value="#{anamneseBean.dmProfessor}"  
    			 rowKey="#{professor.idFuncionario}"  selectionMode="single"
    			 style="padding-top:20px;">  
        <f:facet name="header">Professores</f:facet>    
		<p:column>  
            <f:facet name="header">  
                <h:outputText value="Código" />  
            </f:facet>  
            <h:outputText value="#{professor.idFuncionario}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Professor" />  
            </f:facet>  
            <h:outputText value="#{professor.nome}" />  
        </p:column>  
        
        <p:column style="width:4%">  
        	<f:facet name="header">
        	 <h:outputText value="Selecionar" />
        	</f:facet>
         	<p:commandButton id="selectButtonEditar" actionListener="#{anamneseBean.addProfessor}" process="@this" icon="ui-icon-circle-plus" title="Detail" />
        </p:column> 

    </p:dataTable>   

 </h:panelGroup>
 </h:form>
</p:dialog>
